/**********************************************************
 * ActionScript Development Tool 
 * Copyright (C) 2005 asdt.org 
 * 
 * http://www.asdt.org
 * http://sourceforge.net/projects/aseclipseplugin/
 *
 * This program is free software; 
 * you can redistribute it and/or modify it under the terms of 
 * the GNU General Public License as published by the 
 * Free Software Foundation; either version 2 of the License, 
 * or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the 
 * Free Software Foundation, Inc., 
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 
 * 
 **********************************************************/
package ca.scotthyndman.as2haxe.dom;

import ca.scotthyndman.as2haxe.dom.visitor.IVisitor;

/**
 * @author Martin Schnabel (mb0)
 * @version $ Date : 14.06.2005 : 05:54:17
 * 
 */
public class ASComment extends ASTNode {

	private boolean docComment;

	private String text;

	public ASComment(AST ast) {
		super(ast);
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	/**
	 * @see ca.scotthyndman.as2haxe.dom.visitor.IVisitable#accept(ca.scotthyndman.as2haxe.dom.visitor.IVisitor,
	 *      boolean)
	 */
	public void accept(IVisitor as2Visitor, boolean visitChilds) {
		visitChilds = as2Visitor.visit(this);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		// how to discribe a comment
		String str = (docComment) ? "Doc" : "";
		str += "Comment[" + getFullRegion().toString() + "]";
		return str;
	}

	public boolean isDocComment() {
		return docComment;
	}

	public void setDocComment(boolean value) {
		docComment = value;

//		if (value) {
//			JavaDocParser parser = new JavaDocParser(new JavaDocLexer(
//					new ByteArrayInputStream(getText().getBytes())));
//			try {
//				parser.comment();
//			} catch (RecognitionException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			} catch (TokenStreamException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//			System.out.println(parser.getAST().toStringTree());
//		}
	}

}